package com.phei.netty.protocol.http.xml;


import org.jibx.binding.Compile;
import org.jibx.binding.generator.BindGen;
import org.jibx.runtime.JiBXException;

import java.io.IOException;

public class GenBindFileTool {

    public static void main(String[] args) throws JiBXException, IOException {
        genBindFiles();
        //compile();
    }

    private static void compile() {
        String[] args = new String[2];

        args[0]="-v";

        args[1]="./src/main/jibx/binding.xml";

        Compile.main(args);
    }

    private static void genBindFiles() throws JiBXException, IOException {
        String[] args = new String[9];

        args[0] = "-s";
        args[1] = "src";

        args[2] = "-b";
        args[3] = "binding.xml";

        args[4] = "-v";
        args[5] = "-w";

        args[6] = "-t";
        args[7] = "./src/main/jibx";
        args[8] = "com.phei.netty.protocol.http.xml.pojo.Order";

        BindGen.main(args);
    }
}
